import struct
# This program is FINE

initial_block_num = 89515

# This is in 4 bytes
external_index_offset = 4294967295

# This is in bytes
external_index_offset_in_byte = external_index_offset * 4

# inputFileName = "/home/diaosi/outputDirForIndexes/prunedGov2Index/prunedGov2IndexBasedOn_Machine_Learned/wei_pruning_development_2013-01-26-16-43-47-100%.ext"
inputFileName = "/home/diaosi/outputDirForIndexes/prunedGov2Index/prunedGov2IndexBasedOn_PartialBM25/wei_pruning_development_testing_2013-01-27-21-47-55-100%.ext"
# inputFileName = "/home/diaosi/index_layered_8_exp_non_overlapping.ext"
inputFileHandler = open(inputFileName,"rb")
inputFileHandler.seek(external_index_offset_in_byte)
counter = 0

unknownStartSymbol = 0.0
block_max_score = 0.0
chunk_max_score = 0.0

try:
    fourBytes = inputFileHandler.read(4)
    while fourBytes != "" and counter <= 10:
        # Do stuff with byte.
        print struct.unpack('f', fourBytes)
        fourBytes = inputFileHandler.read(4)
        counter += 1
finally:
    inputFileHandler.close()